$(function() {
    /**
     * 进行登录操作 ；
     */
    $('.login-form').bootstrapValidator({
            message: '必填',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                loginSUser: {
                    message: '必填',
                    validators: {
                        notEmpty: {
                            message: '请输入账号！'
                        },
                        stringLength: {
                            min: 5,
                            max: 30,
                            message: '账号为5字符至30个字符！'
                        },
                        /*remote: {
                         url: 'remote.php',
                         message: 'The username is not available'
                         },*/
                        regexp: {
                            regexp: /^[a-zA-Z0-9_\.]+$/,
                            message: '请输入字符和数字！'
                        }
                    }
                },
                passwordSUser: {
                    validators: {
                        notEmpty: {
                            message: '请输入密码！'
                        }
                    }
                }
            }
        })
        .on('success.form.bv', function(e) {
            e.preventDefault();
            var $form = $(e.target);
            var bv = $form.data('bootstrapValidator');
            $.post($form.attr('action'), $form.serialize(), function(result) {
                if(result.status == true){
                    window.location.href = ("/system/homepage/homePage");
                }else if(result.status == false){

                }else{

                }
            }, 'json');
        });


});



